package cn.fate.core.adaper;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @program: FtCore
 * @description: 拦截
 * @author: xubo
 * @create: 2021-09-14 14:30
 **/
@Configuration
public class CheckLoginAdaper implements WebMvcConfigurer {

    @Bean
    CheckLoginInterceptor loginHandlerInterceptor() {
        return new CheckLoginInterceptor();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginHandlerInterceptor())
                .addPathPatterns("/staff/*")
        ;
    }
}
